wayland: write wl_data_offer data asynchronously
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 10 Oct 2014 18:38:46 +0000 (20:38 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 10 Oct 2014 18:58:55 +0000 (20:58 +0200)
commit69d9746708ef36f1bfdc855acc073fc7aa6e1045
tree057d1e517dc8299f23a0f96618c17baec08b039b
parentf6870e5b79fd9abe573b01d37d7c52476b5c6052
wayland: write wl_data_offer data asynchronously

Currently writing wl_data_offer data into the fd is 1) synchronous, which
is noticeable when transferring large amounts of data, and 2) buggy, write()
error checking is done on the accumulator, breaking both the written data
accounting and error checking itself.

Fix both by making writes asynchonous through GOutputStream, the operation
is spun off and either finished, or cancelled if new data is stored in the
selection while the transfer is active.
gdk/wayland/gdkselection-wayland.c